# Copyright (c) 2025 by Michael Zahniser
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

# Entering Republic space
mission "Message Buoy: Entering Republic space from Pirates"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Republic"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		not "flagship system: Mintaka"
		or
			has "previous system government: Pirate"
			and
				has "flagship system: Alnitak"
				has "previous system: Mintaka"
	on offer
		message
			phrase "entering republic space from pirates"
		fail

"phrase" "entering republic space from pirates"
	"word"
		"全船舶へのメッセージブイ：共和国管理宙域に入りました"
	"word"
		"。青い標識を掲げていない民間船は停船し、海軍要員の指示に従ってください。従わない場合は正当な攻撃目標と見なされます。"
		"。共和国の管轄外の星系からの入域です。外国星系（関係）法に基づき、共和国の港に着陸した際に追加の質問を受ける場合がありますのでご承知おきください。"

mission "Message Buoy: Entering Republic space from Free Worlds (hostile)"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Republic"
		neighbor government "Free Worlds"
		not system "Graffias"
	destination "Earth"
	to offer
		has "chosen sides"
		not "main plot completed"
		"reputation: Republic" < 0
		not "entered system by: takeoff"
		has "previous system government: Free Worlds"
	on offer
		message
			phrase "entering republic space from free worlds (hostile)"
		fail

"phrase" "entering republic space from free worlds (hostile)"
	"word"
		"自由世界の船舶へのメッセージブイ：共和国管理宙域に入りました"
	"word"
		"。無許可の標識を掲げている船舶はすべて海軍要員の指示に従ってください。従わない場合は正当な攻撃目標と見なされます。"
		"。3014年惑星民兵（再編）法に基づき、緑の標識を掲げられるのは認可された民兵の船舶のみです。違法に民兵の緑を掲げている船舶はすべて海軍要員の指示に従ってください。従わない場合は正当な攻撃目標と見なされます。"
		"。いわゆる「自由世界」に属する船舶はすべて停船し、海軍要員の指示に従ってください。従わない場合は正当な攻撃目標と見なされます。"

mission "Message Buoy: Entering Republic space from Free Worlds"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Republic"
		neighbor government "Free Worlds"
		not system "Graffias"
	destination "Earth"
	to offer
		has "main plot completed"
		not "entered system by: takeoff"
		has "previous system government: Free Worlds"
	on offer
		message
			phrase "entering republic space from free worlds"
		fail

"phrase" "entering republic space from free worlds"
	"word"
		"全船舶へのメッセージブイ：共和国管理宙域に入りました"
	"word"
		"。スキャンに備えてください。"
		"。星々に平和を。"
		"。共和国の港に着陸した際は、外来種や病原体の検査のため船をスキャンに供してください。"
		"。ギャラクティック・エントリー認定市民の方は、惑星IDのご提示で入国審査の列をスキップできます。"
		"。共和国の管轄外の星系からの入域です。外国星系（関係）法に基づき、共和国の港に着陸した際に追加の質問を受ける場合がありますのでご承知おきください。"



# Entering Syndicate space
mission "Message Buoy: Entering Syndicate space"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Syndicate"
		neighbor government "Republic" "Neutral" "Independent"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		or
			has "previous system government: Republic"
			has "previous system government: Neutral"
			has "previous system government: Independent"
	on offer
		message
			phrase "entering syndicate space"
		fail

"phrase" "entering syndicate space"
	"word"
		"全船舶へのメッセージブイ："
	"word"
		"銀河最大の自由貿易圏、"
		"銀河で最も経済的に自由な地域、"
		"共和国の産業力の屋台骨、"
		"銀河におけるあなたの未来がある場所、"
		"チャンスにあふれた"
		""
	"word"
		"シンジケート宙域へようこそ。"



# Entering Free Worlds space
mission "Message Buoy: Entering Free Worlds space from Republic"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Free Worlds"
		neighbor government "Republic" "Neutral" "Independent"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		or
			has "previous system government: Republic"
			has "previous system government: Neutral"
			has "previous system government: Independent"
	on offer
		message
			phrase "entering free worlds space from republic"
		fail

"phrase" "entering free worlds space from republic"
	"word"
		"全船舶へのメッセージブイ：自由宙域に入りました"
	"word"
		"。安全な飛行を、船長。"
		"。南部リムに自由を！"
		"。団結せよ。"

mission "Message Buoy: Entering Free Worlds space from Pirate"
	invisible
	entering
	non-blocking
	repeat
	source
		government "Free Worlds"
		neighbor government "Pirate" "Independent"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		has "previous system government: Pirate"
	on offer
		message
			phrase "entering free worlds space from pirate"
		fail

"phrase" "entering free worlds space from pirate"
	"word"
		"メッセージブイ：自由宙域に入りました"
	"word"
		"。自由世界の法により、商船は青い標識で身元を示す必要があります。無許可の標識を掲げた船舶は、発見次第撃たれる場合があります。"



# Entering Deep space
mission "Message Buoy: Entering Deep space"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Zosma"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		or
			has "previous system: Alphard"
			has "previous system: Algieba"
	on offer
		message
			text "Message buoy to all ships: Welcome to Deep space. We bid you peace, prosperity, and progress."
		fail



# Other message buoys
mission "Message Buoy: Martini Restricted"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Pollux"
	destination "Earth"
	to offer
		"reputation: Republic" < 80
		has "event: war begins"
		not "martini recovers"
	on offer
		message
			text "Message buoy to all ships: Due to the attacks of July 4, 3014, access to the Republic planet of Martini is restricted."
		fail

mission "Message Buoy: Geminus Restricted"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Castor"
	destination "Earth"
	to offer
		"reputation: Republic" < 80
		has "event: war begins"
		not "geminus rebuilt"
	on offer
		message
			text "Message buoy to all ships: Due to the attacks of July 4, 3014, access to the Republic planet of Geminus is restricted."
		fail

mission "Message Buoy: Graffias"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Graffias"
		government "Republic"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		has "event: war begins"
		not "main plot completed"
	on offer
		message
			text "Message buoy to all ships: You are entering the Republic system of Graffias. Poisonwood is restricted to solely Merchant or Republic ships."
		fail

mission "Message Buoy: Capella"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Capella"
	destination "Earth"
	to offer
		"reputation: Republic" < 10
	on offer
		message
			text "Message buoy to all ships: Access to the Republic planet of Hermes is restricted without spaceport authority approval."
		fail

mission "Message Buoy: Elnath"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Elnath"
	destination "Earth"
	to offer
		"reputation: Republic" < 100
	on offer
		message
			text "Message buoy to all ships: All inhabited installations in the Elnath system are restricted to employees of Lovelace Labs. Please refuel or repair in another system."
		fail

mission "Message Buoy: Occupied Greenrock"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Shaula"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
		has "event: fw suppressed Greenrock"
		not "event: fw abandoned Greenrock"
	on offer
		message
			phrase "occupied greenrock message buoy"
		fail

"phrase" "occupied greenrock message buoy"
	"word"
		"全船舶へのメッセージブイ：シャウラ星系は自由世界の占領下にあります。"
	"word"
		" 無許可の標識を掲げている船舶はすべて民兵の船に出頭してください。従わない場合は正当な攻撃目標と見なされます。"
		" 入出域するすべての船舶に対し、禁制品と逃亡者のスキャンを実施しています。"
		" 惑星グリーンロックの海賊行為が根絶されるまで、我々は駐留を続けます。"

mission "Message Buoy: beyond Farpoint"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Mintaka"
	destination "Earth"
	to offer
		has "previous system: Alnitak"
	on offer
		message
			text "Message buoy to all ships: You have exited Republic-controlled space. Assistance from Navy vessels is limited beyond the system of Alnitak. It is recommended you return to Farpoint immediately."
		fail

mission "Message Buoy: Megaparsec"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Mirfak"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
	on offer
		message
			phrase "message buoy: megaparsec"
		fail

"phrase" "message buoy: megaparsec"
	"word"
		"全船舶へのメッセージブイ："
	"word"
		" メガパーセク社の本拠地、ミルファクへようこそ。"
		" 武装と積載の完璧なバランスをお求めなら、メガパーセク・スプリンターを。"
		" メガパーセク・バウンダー――恒星間航行の新たな基準。"

mission "Message Buoy: Tarazed Corporation"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Tarazed"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
	on offer
		message
			text "Message buoy to all ships: Welcome to the home of the Tarazed Corporation - the galaxy-leading manufacturer of sleek, modern spacecraft."
		fail

mission "Message Buoy: Betelgeuse Shipyards"
	invisible
	entering
	non-blocking
	repeat
	source
		system "Betelgeuse"
	destination "Earth"
	to offer
		not "entered system by: takeoff"
	on offer
		message
			text "Message buoy to all ships: Betelgeuse Shipyards - centuries of service."
		fail
